from django.db import models

# Create your models here.
class GoodsInfo(models.Model):
    type = models.CharField(u'类型', max_length=20)
    name = models.CharField(u'名字', max_length=256)
    price = models.CharField(u'单价', max_length=20)
    unit = models.CharField(u'单位', max_length=10)
    discount = models.BooleanField()

    def __str__(self):
        return self.name


class ShoppingCar(models.Model):
    id = models.IntegerField(primary_key=True)
    type = models.CharField(u'类型', max_length=20)
    name = models.CharField(u'名字', max_length=256)
    price = models.CharField(u'价格', max_length=20)
    unit = models.CharField(u'单位', max_length=10)
    count = models.IntegerField(u'数量')
    subtotal = models.CharField(u'小计', max_length=30)
    discount = models.BooleanField()

    def __str__(self):
        return self.name